home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga CD-ROM Collection
/
Amiga CD-ROM Collection - Auge 4000 and Cactus and Demo Util.iso
/
auge4000
/
46
/
lib
/
string
/
strtok.c
< prev
Wrap
C/C++ Source or Header
|
1990-06-20
|
495b
|
41 lines
/*
* STRTOK.C
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <string.h>
char *
strtok(cmd, toks)
char *cmd;
const char *toks;
{
static char *Cmd;
short i;
char *ptr;
if (cmd == NULL) {
cmd = Cmd;
if (cmd == NULL)
return(NULL);
}
/*
* skip whitespace
*/
while (*cmd && strchr(toks, *cmd))
++cmd;
if (*cmd == 0)
return(NULL);
if (ptr = strpbrk(cmd, toks))
*ptr++ = 0;
Cmd = ptr;
return(cmd);
}